/**
 * 
 */
package eu.news.data.hibernate.dao;
import org.hibernate.Query;

import eu.news.data.dao.PictureDAO;
import eu.news.data.hibernate.pojo.HB_Picture;
import eu.news.data.pojo.Picture;


/**
 * @author WZZ
 *
 */
public class HB_PictureDAO extends HibernateBaseDAO<Picture> implements PictureDAO{
	
	protected HB_PictureDAO() {}
	
	public Picture getById(int id){
		String hql="from Picture where id=:id";
		Query query=session.createQuery(hql);
		query.setSerializable("id", id);
		return (Picture) query.uniqueResult();
	}

	@Override
	public Picture newEntity() {
		return new HB_Picture();
	}
}
